package com.beaven.imserver.net.bean.card;

import com.beaven.imserver.net.bean.db.Message;
import com.google.gson.annotations.Expose;
import java.time.LocalDateTime;

/**
 * author: Beaven
 * time: 2017/5/17 14:47
 *
 * 消息的卡片Model
 */
public class MessageCard {
  @Expose
  private String id; // Id
  @Expose
  private String content;// 内容
  @Expose
  private int type;// 消息类型
  @Expose
  private LocalDateTime createAt;// 创建时间
  @Expose
  private String groupId;// 如果是群信息，对应群Id
  @Expose
  private String senderId;// 发送者Id，不为空
  @Expose
  private String receiverId;// 接收者Id

  public MessageCard(Message message) {
    this.id = message.getId();
    this.content = message.getContent();
    this.type = message.getType();
    this.createAt = message.getCreateAt();
    this.groupId = message.getGroupId();
    this.senderId = message.getSenderId();
    this.receiverId = message.getReceiverId();
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public int getType() {
    return type;
  }

  public void setType(int type) {
    this.type = type;
  }

  public LocalDateTime getCreateAt() {
    return createAt;
  }

  public void setCreateAt(LocalDateTime createAt) {
    this.createAt = createAt;
  }

  public String getGroupId() {
    return groupId;
  }

  public void setGroupId(String groupId) {
    this.groupId = groupId;
  }

  public String getSenderId() {
    return senderId;
  }

  public void setSenderId(String senderId) {
    this.senderId = senderId;
  }

  public String getReceiverId() {
    return receiverId;
  }

  public void setReceiverId(String receiverId) {
    this.receiverId = receiverId;
  }
}
